<!DOCTYPE html>
<html lang="pl">
    <head>
        <base href="<?= $this->baseUrl(); ?>/" />
        <meta http-equiv="content-language" content="pl" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <?= $this->headTitle('Toruń online')->setSeparator(' - '); ?>
        <link rel="icon" href="<?= $this->baseUrl(); ?>/favicon.ico" type="image/x-icon" />

        <?=
        $this->headLink()
                ->prependStylesheet($this->baseUrl() . '/css/style.css')
//                ->prependStylesheet($this->baseUrl() . '/css/table.css')
                ->prependStylesheet($this->baseUrl() . '/css/smart-button.css')
                ->prependStylesheet($this->baseUrl() . '/libs/toi/css/flash-messenger.css')
                ->prependStylesheet($this->baseUrl() . '/libs/bootstrap/css/bootstrap.min.css')
                ->prependStylesheet($this->baseUrl() . '/libs/prettyphoto/css/prettyPhoto.css')
                ->prependStylesheet($this->baseUrl() . '/libs/jquery-ui/css/jquery-ui.css')
                ->prependStylesheet($this->baseUrl() . '/libs/normalize/normalize.css')
        ?>
        <?= $this->headStyle() ?>
        <?php $this->headScript()->captureStart(Zend_View_Helper_Placeholder_Container_Abstract::PREPEND); ?>
        var isIE = /*@cc_on!@*/!1;  // f*g IE
        var CONST = new Object();
        CONST.baseUrl = '<?= $this->baseUrl() ?>';
        <?php $this->headScript()->captureEnd(); ?>
        <?=
        $this->headScript()
                ->prependFile($this->baseUrl() . '/js/script.js')
                ->prependFile($this->baseUrl() . '/libs/toi/js/utils.js')
                ->prependFile($this->baseUrl() . '/libs/toi/js/xhr.js')
                ->prependFile($this->baseUrl() . '/libs/toi/js/flash-messenger.js')
                ->prependFile($this->baseUrl() . '/libs/bootstrap/js/bootstrap.js')
                ->prependFile($this->baseUrl() . '/libs/prettyphoto/js/jquery.prettyPhoto.js')
                ->prependFile($this->baseUrl() . '/libs/jquery-ui/js/jquery-ui.js')
                ->prependFile($this->baseUrl() . '/js/jquery.js')
        ?>

    </head>
    <body>
        <div class="container wrapper">
            <div class="row header">
                <div class="logo">
                    <a href="<?= $this->baseUrl() ?>" title="<?= $this->translate('XXX_LAYOUT_HEADER_LOGO_LINK_TITLE') ?>">
                        <img src="<?= $this->baseUrl() ?>/graph/logo-1.jpg" alt="<?= $this->translate('XXX_LAYOUT_HEADER_LOGO_IMG_ALT') ?>" />
                    </a>
                </div>
                <div class="span5 offset7 account navbar">
                    <div class="navbar-inner">
                        <?= $this->render('common/account-no-auth.phtml') ?>
                        <?= $this->render('common/account-auth.phtml') ?>
                    </div>
                </div>

                <div class="quick-search">
                    <form class="form-search clearfix" action="/search/offer" method="get">
                        <div class="input-append">
                            <input type="text" class="span3 search-query" name="q" placeholder='Szukaj w Toruniu'>
                            <button type="submit" class="btn btn-primary">Szukaj</button>
                        </div>
                    </form>
                </div>

                <div class="date-container">
                    <?= My_DateUtil::getPrettyDateString('pl-PL') ?>&nbsp;&nbsp;&nbsp;&nbsp;<?= My_DateUtil::getNameDay() ?>
                </div>
            </div>
            <?= $this->render('adv/top.phtml') ?>
            <div class="row-fluid">
                <div class="span3 column-left">
                    <?= $this->render('column-left/main-menu.phtml') ?>
                    <?= $this->render('column-left/weather.phtml') ?>
                    <?= $this->render('adv/column-left.phtml') ?>
                </div>
                <?php
                $isColumn3 = isset($this->isColumn3) ? $this->isColumn3 : false;
                ?>
                <div class="main_column <?= $isColumn3 ? 'span7' : 'span9' ?>">
                    <?php if (isset($this->contentTitle) && !empty($this->contentTitle)): ?>
                        <div class="content-title bg-blue"><?= $this->contentTitle ?></div>
                    <?php endif ?>
                    <?= $this->render('common/flash-messenger.phtml') ?>
                    <?= $this->layout()->content ?>
                </div>
                <?php if ($isColumn3): ?>
                    <div class="span2 column-right">
                        <?= isset($this->columnRightContent) ? $this->columnRightContent : '' ?>
                    </div>
                <?php endif ?>
            </div>

            <?= $this->render('adv/bottom.phtml') ?>

            <div class="row-fluid footer">
                <div class="span3 main-callendar">
                    <div class="head">Kalendarz imprez</div>
                    <div class="eventCalendarFooter"></div>
                    <script type="text/javascript">
                        $(function() {
                            $('.eventCalendarFooter').datepicker({
                                dateFormat: 'yy-mm-dd',
                                firstDay: 1,
                                onSelect: function(date, obj) {
                                    var url = '/event/index/';
                                    url += 'start_date/' + date;
                                    document.location = url;
                                }
                            });
                        });
                    </script>
                </div>
                <div class="span6 shortcuts">
                    <?php
                    $daoOffer = new Application_Model_DAO_Offer();
                    $list = $daoOffer->getShortOfferList();
                    ?>
                    <div class="head">Ostatnio dodane ogłoszenia</div>
                    <ul>
                        <?php foreach ($list as $entry): ?>
                            <li><a href="<?= $this->url(array('controller' => 'offer', 'action' => 'show', 'id' => $entry['code'], 'title' => $entry['title']), 'default', true) ?>"><?= $entry['title'] ?></a></li>
                        <?php endforeach; ?>
                    </ul>
                    <?php
                    $daoCatalog = new Application_Model_DAO_Catalog();
                    $list = $daoCatalog->getShortCatalogList();
                    ?>
                    <div class="head">Ostatnio dodane firmy i instytucje</div>
                    <ul>
                        <?php foreach ($list as $entry): ?>
                            <li><a href="<?= $this->url(array('controller' => 'catalog', 'action' => 'show', 'id' => $entry['code'], 'title' => $entry['title']), 'default', true) ?>"><?= $entry['title'] ?></a></li>
                        <?php endforeach; ?>
                    </ul>
                </div>
                <div class="span3">
                    <iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2FTorunOnline&amp;width=181&amp;height=290&amp;show_faces=true&amp;colorscheme=light&amp;stream=false&amp;border_color&amp;header=true&amp;appId=174803089285758" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:242px; height:290px;" allowTransparency="true"></iframe>
                </div>
            </div>
            <div class="row-fluid footer bg-blue">
                <div class="span2 offset1">
                    <h4>Na skróty</h4>
                    <ul>
                        <li><a href="/offer">Ogłoszenia</a></li>
                        <li><a href="/catalog">Katalog firm i instytucji</a></li>
                        <li><a href="/event">Repertuar kin i teatrów</a></li>
                        <li><a href="/external/transport">Komunikacja miejska</a></li>
                    </ul>
                </div>
                <div class="span2">
                    <h4>Pomoc</h4>
                    <ul>
                        <li><a href="<?= $this->url(array('controller' => 'static-page', 'action' => 'show', 'id' => 'regulamin'), 'default', true) ?>">Regulamin</a></li>
                        <li><a href="<?= $this->url(array('controller' => 'static-page', 'action' => 'show', 'id' => 'polityka-prywatnosci'), 'default', true) ?>">Polityka prywatności</a></li>
                    </ul>
                </div>
                <div class="span2">
                    <h4>Kontakt z nami</h4>
                    <ul>
                        <li><a href="<?= $this->url(array('controller' => 'static-page', 'action' => 'show', 'id' => 'wspolpraca'), 'default', true) ?>">Współpraca</a></li>
                        <li><a href="<?= $this->url(array('controller' => 'static-page', 'action' => 'show', 'id' => 'reklama'), 'default', true) ?>">Reklama</a></li>
                        <li><a href="<?= $this->url(array('controller' => 'static-page', 'action' => 'show', 'id' => 'cennik'), 'default', true) ?>">Cennik</a></li>
                        <li><a href="<?= $this->url(array('controller' => 'static-page', 'action' => 'show', 'id' => 'kontakt'), 'default', true) ?>">Kontakt</a></li>
                    </ul>
                </div>
                <div class="span4 offset1 credits">
                    <p>Portal miejski <strong>torunonline.info</strong></p>
                    <p>Wszelkie prawa zastrzeżone</p>
                    <p>Korzystanie z serwisu oznacza akceptację regulaminu</p>
                    <p>Projekt i realizacja 
                        <a href="http://www.kkit.pl/"><img src="http://www.kkit.pl/logos/kkit_small.png" alt="KKIT" /></a>
                    </p>
                </div>
            </div>
        </div>
    </body>
</html>
